
#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include "rngs.h"
#include "math.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>

int loopFunctions(int num1, int* num2, struct gameState* status, int* num3) {
	num1 = 0;
	for (*num2 = 0; *num2 < sizeof(struct gameState); *num2++) {
		((char*) &*status)[*num2] = floor(Random() * 256);
	}
	while (*num3 != 24) {
		status->supplyCount[*num3] = floor(Random() * (25 + 1));
		*num3 = *num3 + 1;
	}
	return num1;
}

int main() {
	int num1;
	int num2;
	struct gameState status;
	int num3= 0;
	SelectStream(2);
	PutSeed(3);

	for (num1 = loopFunctions(num1, &num2, &status, &num3);;) {
		GameOverUnitTest(&status);
	}

	printf ("Test complete");
	return 0;
}

int GameOverUnitTest(struct gameState *status) {
	int num4;// itnilaize variables
	int num5 = 0;
	int overstatus = isGameOver(status);

	if (status->supplyCount[province] == 0) {
		assert (overstatus == 1);
		return overstatus;
	}

	for (num4 = 0; num4 < 25; num4++) {
		if (status->supplyCount[num4] == 0) {
			num5 = num5 + 1;
		}
		if (num5 >= 3) {
			assert(overstatus == 1);
			return overstatus;
		}
	}

	assert(overstatus == 0);
	return overstatus;
}

